import axios from '../utils/http' // 导入http中创建的axios实例
import { Base64 } from '../utils/base'
let baseObj = new Base64()
const base_url = process.env.BASE_API
const inter_url = '/proxy/cam/proxy/common?api='

const repairApi = {
  // 获取卡券
  getCoupon(params) {
    let url = 'CustomerSolicitFacade-getCoupon'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 维修预约单新增
  addRepairBooking(params) {
    let url = 'CustomerSolicitFacade-addRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 维修预约单编辑
  updateRepaitBooking(params) {
    let url = 'CustomerSolicitFacade-updateRepaitBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },

  // 维修预约单列表查询
  queryRepairBooking(params) {
    let url = 'CustomerSolicitFacade-queryRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 维修预约单详情
  queryRepairBookingById(params) {
    let url = 'CustomerSolicitFacade-queryRepairBookingById'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },

  /* 维修工单 */
  // 维修工单列表
  queryRepairWorkOrder(params) {
    let url = 'CustomerSolicitFacade-queryRepairWorkOrder'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },

  // 维修工单详情
  queryRepairWorkOrderById(params) {
    let url = 'CustomerSolicitFacade-queryRepairWorkOrderById'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 取消维修单
  cancelRepairBooking(params) {
    let url = 'CustomerSolicitFacade-cancelRepairBooking'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 申请结算
  repairWorkOrderSetOver(params) {
    let url = 'CustomerSolicitFacade-repairWorkOrderSetOver'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 修改预约进场时间
  updateRepairBookDateIn(params) {
    let url = 'CustomerSolicitFacade-updateRepairBookDateIn'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  // 修改预约进场时间
  updateRepairBookServer(params) {
    let url = 'CustomerSolicitFacade-updateRepairBookServer'
    return axios.post(`${base_url}${inter_url}${baseObj.encode(url)}`, params)
  },
  //修改配置
  configAddUpdate(params){
    return axios.post(`${base_url}/proxy/baokt/config/addUpdate`, params)
  },
  // 快速新增草稿数据
  quickAddUpdate(params){
    return axios.post(`${base_url}/proxy/carAccidentDraft/quickAddUpdate`, params)
  },
  // 草稿箱列表分页
  draftListPage(params){
    return axios.post(`${base_url}/proxy/carAccidentDraft/draftListPage`, params)
  },
  // 草稿详情
  getDraft(params){
    return axios.get(`${base_url}/proxy/carAccidentDraft/getDraft`, {params})
  },
  // 草稿条数
  listNum(params){
    return axios.post(`${base_url}/proxy/carAccidentDraft/listNum`, {params})
  },
  // 编辑草稿
  draftAddUpdate(params){
    return axios.post(`${base_url}/proxy/carAccidentDraft/save`, params)
  },


}

export default repairApi
